<%@ page language="java" contentType="text/html; utf-8" pageEncoding="utf-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<div class="fly-panel fly-column">
  <div class="layui-container">
    <ul class="layui-clear">
      <li class="layui-hide-xs" id="category-0"><a href="/">首页</a></li>
      <c:forEach items="${categories}" var="category">
        <li id="category-${category.categoryId}"><a href="${category.categoryUrl}">${category.categoryName}</a></li>
      </c:forEach>
      <script>
        var elementById = document.getElementById('${category_id}');
        if(elementById){
            elementById.classList.add('layui-this');
        }
      </script>
      <%--<li><a href="fly-3.0/html/jie/index.html">分享<span class="layui-badge-dot"></span></a></li>--%>
      <%--<li><a href="fly-3.0/html/jie/index.html">讨论</a></li>--%>
      <%--<li><a href="fly-3.0/html/jie/index.html">建议</a></li>--%>
      <%--<li><a href="fly-3.0/html/jie/index.html">公告</a></li>--%>
      <%--<li><a href="fly-3.0/html/jie/index.html">动态</a></li>--%>

      <!-- 用户登入后显示 -->
      <c:if test="${!empty sessionScope.user}">
        <li class="layui-hide-xs layui-hide-sm layui-show-md-inline-block"><span class="fly-mid"></span></li>
        <li class="layui-hide-xs layui-hide-sm layui-show-md-inline-block"><a href="/user/post/">我发表的贴</a></li>
        <li class="layui-hide-xs layui-hide-sm layui-show-md-inline-block"><a href="/user/post/#collection">我收藏的贴</a></li>
      </c:if>
    </ul>

    <div class="fly-column-right layui-hide-xs">
      <span class="fly-search"><i class="layui-icon"></i></span>
      <a href="/article/add/" class="layui-btn">发表新帖</a>
    </div>
    <div class="layui-hide-sm layui-show-xs-block" style="margin-top: -10px; padding-bottom: 10px; text-align: center;">
      <a href="/article/add/" class="layui-btn">发表新帖</a>
    </div>
  </div>
</div>
